<template>
<el-form label-width="80px" ref="form" :model="form">
  <el-row>
    <el-col :span="22">
      <el-form-item label="波次号" prop="wavePickingCode">
        <el-input v-model="form.wavePickingCode" disabled />
      </el-form-item>
    </el-col>
    <el-col :span="22">
      <el-form-item label="总数量" prop="waveCount">
        <el-input v-model="form.waveCount" disabled />
      </el-form-item>
    </el-col>
  </el-row>
  <el-button type="primary" @click="submit" style="margin: 20px 240px">取消波次</el-button>
</el-form>
</template>
<script>
import { cancelWaveTipsPrompt, cancelWaveTips } from "@/api/outStorage";
export default {
  name: 'CancelWave',
  props:{
    cancelSelect: {
      type: Array,
      required: true
    }
  },
  data() {
    return {
      form: {},
    }
  },
  created() {
    this.showFormData()
  },
  methods: {
    // 展示数据
    showFormData() {
      this.$set(this.form,'wavePickingCode',this.cancelSelect[0].wavePickingCode)
      cancelWaveTipsPrompt(this.form.wavePickingCode).then(res => {
        this.$set(this.form,'waveCount',res.waveCount)
      })
    },
    submit(){
      cancelWaveTips(this.form.wavePickingCode).then(res => {
        this.$message.success(res.msg)
      }).finally(() => {
        this.$emit('operationComplete')
      })
    }
  }
}
</script>
